package com.zl.beans;

import com.zl.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * @author ZLL
 * @date create in 2018/04/27
 */

@Configuration
public class MyBeanConfigure {

    @Bean(name = "u1")
    @Profile("dev")
    public User getUserInstance(){

        System.out.println("com.zl.beans.MyBeanConfigure.getUserInstance()");
        return new User(1,"zs");
    }

    @Bean(name = "u2")
    @Profile("test")
    public User getUserInstance2(){

        System.out.println("com.zl.beans.MyBeanConfigure.getUserInstance2()");
        return new User(2, "lisi");
    }
}
